#!/bin/bash
#

#判断脚本 是否有参数
if [ -z $1 ]; then
	echo "Help: $0 <IO|SQL>"
	exit 88
fi
#截取线程状态
state=$(mysql -uroot -pZwd954827,. -e "show slave status\G;" 2> /dev/null | grep "Slave_${1}_Running:" | awk '{print $2}')

if [ $state == "Yes" ]; then
	echo 1
else
	echo 0
fi
